Fix boot loader hangs with syslinux's 32-bit vesamenu module.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 4 Jun 2007 14:32:11 +0000 (15:32 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 4 Jun 2007 14:32:11 +0000 (15:32 +0100)
commit1af8c5189c27bd83293bebae780b93fffeea2ee9
tree93d1aedda8e3461e3624afa5a97535f4599f102e
parentd47ae8ebf066aafb65763432f5a6bc7909b4639a
Fix boot loader hangs with syslinux's 32-bit vesamenu module.

Syslinux can load 32-bit UI code for menu handling.  But the core of
syslinux is still 16-bit.  When it jumps to this 32-bit code, it
installs a set of 32-bit interrupt trap handlers which just bounce the
interrupts back to 16-bit mode.

But this plays badly with vmxassist.  When running 16-bit boot loader
code, vmxassist installs its own trap handlers which bounce vPIC
interrupts back down to 16-bit mode.  The trap handlers live at
int 0x20 to 0x2f, so when the 16-bit code tries to reprogram the vPIC,
vm86 rewrites the outb()s on the fly to set the irq_base vectors
accordingly.

So when syslinux enters 32-bit mode, the vPIC has still been
programmed to point to vmxassist's bounce traps, even though vmxassist
is no longer active once the guest is running 32-bit code.  So the
wrong interrupts get delivered to the guest.

Fix this by restoring the rombios vPIC irq_base vectors when we leave
vmxassist mode, and returning the vmxassist traps when we reenter it.
These irq base values are hard-coded in this patch, but they are
already hard-coded in vmxassist so any boot code that relies on
changing them will already fail.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
xen/arch/x86/hvm/vmx/vmx.c